﻿
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>{{$title}}</title>

    <link href="{{URL::asset('/inspinia/css/bootstrap.min.css')}}" rel="stylesheet">
    <script src="{{URL::asset('/inspinia/js/jquery-2.1.1.js')}}"></script>
    <script src="{{URL::asset('/inspinia/js/bootstrap.min.js')}}"></script>

    <link href="{{URL::asset('/inspinia/css/animate.css')}}" rel="stylesheet">
    <link href="{{URL::asset('/inspinia/css/style.css')}}" rel="stylesheet">

    <script src="{{'/Lib/layui/layui.js'}}"></script>

</head>

<body class="gray-bg" style="background-color: #fff">
<div class="row">
    <div class="col-lg-12">
        <div class="ibox">
            <div class="ibox-content">
                <form id="form" action="#" class="layui-form wizard-big wizard clearfix" role="application" novalidate="novalidate">

                    <div style="margin: 0 20px;">
                        <fieldset id="form-p-0" role="tabpanel" aria-labelledby="form-h-0" class="body current" aria-hidden="false">

                            <div class="row">
                                <div style="width: 250px;float: left;margin-top: 10px;margin-left: 17px;">
                                    <input id="mail" lay-verify="required|email" name="mail"  placeholder="邮箱" type="text" class="form-control required" value="">
                                </div>
                                <input id="_token" type="hidden" name="_token" value="{{ csrf_token()}}"/>
                                <button lay-submit lay-filter="*" type="button" style="margin: 10px;float: left" class="btn btn-warning  btn-sm searchbtn send-code" >发送重置链接</button>
                            </div>

                        </fieldset>


                    </div>
                    <input id="_token" type="hidden" name="_token" value="{{ csrf_token()}}"/>
                </form>
            </div>
        </div>
    </div>
</div>

</body>

</html>

<script>

    layui.use('layer', function(){

    });
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(*)', function(data){
            var $this = $(data.elem);
            $this.attr('disabled', 'disabled');

            $.ajax({
                url: '{{URL::route('admin_login_forgotpassmail')}}',
                data: data.field,
                type: 'post',
                cache: false,
                dataType: 'json',
                success: function (data) {
                    if(data['status'] == 1){
                        layer.msg('发送成功', { icon: 1});
                        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        window.parent.parentRefresh();
                        parent.layer.close(index);

                    }else {
                        layer.msg(data['msg'], { icon: 2});
                    }
                    $this.attr('disabled', false);
                },
                error: function () {
                    $this.attr('disabled', false);
                }
            });
            return false;
        });
    });

</script>